<?php

class DefaultController extends Controller {

	public function actionIndex() {
		$model = new Reviews;
		$this->performAjaxValidation($model);
		$this->render('index');
	}

	protected function performAjaxValidation($model) {
		if (isset($_POST['ajax']) && $_POST['ajax'] === 'reviews-form') {
			echo CActiveForm::validate($model);
			Yii::app()->end();
		}
	}

}
